/********************************************************************
	file name:	test_header.h
	created:	2012/03/23 14:08
	author:		supercaco@sina.com
	purpose:	test base header file
*********************************************************************/
#ifndef _HY_TEST_HEADER_H_
#define _HY_TEST_HEADER_H_

class test_base
{
public:
	test_base(){}
	~test_base(){}

	virtual void run(){}

};


//////////////////////////////////////////////////////////////////////////
//robot
#include "hy_robot.h"

#ifdef INCLUDE_ALL
#include "hy_robot.cpp"
#endif
class test_robot : public test_base
{
public:
	virtual void run()
	{
		
		robot.init();
		robot.run();
	}
	hy_robot robot;
};


//////////////////////////////////////////////////////////////////////////
//test chat

#include "hy_chat_service.h"
#include "test_chat_client.h"

class test_chat : public test_base
{
public:
	virtual void run()
	{
		chat.init();
		chat.run();
	}
	hy_chat_service chat;
};

class test_chat_client : public test_base
{
public:
	virtual void run()
	{
		int count = 100;
		for(int i = 0; i < count; i++)
		{
			hy_chat_client* client = new hy_chat_client("192.168.254.146",3235);
			client->connect();
			_chats.push_back(client);
		}
		while(true)
		{
			//for (size_t i = 0; i < _chats.size(); i++)
			//{
			//	_chats[i]->chat();
			//}
			hy_trace("send round msg");
			hy_os::hy_sleep(3000000);
		}
	}

	std::vector<hy_chat_client*> _chats;
};

#endif  //_HY_TEST_HEADER_H_
